﻿/*
统计立方数 
Time Limit:1000MS  Memory Limit:32768K


Description:
有一堆正整数，统计其中有多少立方数。

Input:
输入数据有一些正整数，其每个数都小于2^32。若该数为0，则应结束统计。 
Output:
输出所统计的立方数个数。 
Sample Input:
1 3 5 7 9 11 15 17 19 21 23 25 27 0
Sample Output:
2
*/
#include <vector>
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int main()
{
	unsigned count=0U;
	for (unsigned positive; cin>>positive && positive;)
	{
		double cube_root=pow((double)positive, 1.0/3);
		unsigned cube_root0=(unsigned)cube_root;
		if(fabs(cube_root-cube_root0)<1e-6)
		{
			count++;
		}
		else
		{
			unsigned cube_root1=cube_root0+1U;
			if(cube_root0*cube_root0*cube_root0==positive ||
				cube_root1*cube_root1*cube_root1==positive)
				count++;
		}

	}
	cout<<count;
	return 0;
}
/*
int main()
{
	vector<unsigned> vints;
	for (unsigned positve; cin>>positve && positve;)	
		vints.push_back(positve);

	if(0==vints.size())
	{
		cout<<1<<endl;
		return -1;
	}
	unsigned maximum=*max_element(vints.begin(), vints.end());
	unsigned minimum=*min_element(vints.begin(), vints.end());

	
	vector<unsigned> cubics;
	unsigned cubic=0u;
	unsigned i=(unsigned)pow((double)minimum, 1.0/3);
	for (; cubic<= maximum;++i)
	{
		cubic=i*i*i;
		cubics.push_back(cubic); 
	}

	int sum=0;
	for (vector<unsigned>::iterator it = vints.begin(); it != vints.end(); ++it)
	{
		if(binary_search(cubics.begin(), cubics.end(), *it))
			++sum;
	}
	cout<<sum;

	return 0;
}
*/